import pygame,PygameCrew as pycr
from asset.constants import*
pygame.init()
img_hook=pygame.image.load("./img/hook.png").convert()
img_hook.set_colorkey(TEMP)

img_markarrow=pygame.image.load("./img/MarkArrow.png").convert()
img_markarrow=pycr.ReplaceColor(img_markarrow,TEMP2,REVEDIT_BACKGROUND)
img_markarrow.set_colorkey(TEMP)
size_markarrow=img_markarrow.get_size()

img_cursorarrow=pygame.image.load("./img/CursorArrow.png").convert()
img_cursorarrow=pycr.ReplaceColor(img_cursorarrow,TEMP2,REVEDIT_BACKGROUND)
img_cursorarrow.set_colorkey(TEMP)
size_cursorarrow=img_cursorarrow.get_size()

img_copycursor=pygame.image.load("./img/CopyCursor.png").convert()
img_copycursor=pycr.ReplaceColor(img_copycursor,TEMP2,REVEDIT_BACKGROUND)
img_copycursor.set_colorkey(TEMP)

grids:"dict[str,pygame.Surface]"=dict()
def loadgrid(size:str):
    if grids.get(size) is None:
        try:
            img_grid=pygame.image.load("./img/grid"+size+".png").convert()
            img_grid=pycr.ReplaceColor(img_grid,TEMP2,REVEDIT_BACKGROUND_DIMMED)
            img_grid.set_colorkey(TEMP)
            grids[size] = img_grid
        except:return pycr.NOTEXT
    return grids[size]
loadgrid("32")
loadgrid("16")
loadgrid("8")
ico_main=pygame.image.load("./img/Elivo_Icon.png")
ico_editor=pygame.image.load("./img/Editor_Icon.png")
sound_click=pygame.mixer.Sound("./img/click.wav")
def play_click():sound_click.play()